﻿@using CodeCamp.Models.Shared
@model CodeCamp.Models.Email.EmailItemEditViewModel

@{
    ViewBag.Title = "";
    if ((@Model != null) && (@Model.EventDisplayName != null))
    {
        ViewBag.Title = @Html.Encode(@Model.EventDisplayName + " | Add Email");
    }
    else
    {
        ViewBag.Title = "Code Camp | Add Email";
    }
}

@section headaddon {
<style>
    .editor-label
    {
        margin-top: 10px;
        width: 30em;
    }
    fieldset label 
    {
        width: 30em;
    }
    table.no-border
    {
        border-style:none;
    }
    td.no-border
    {
        border-style:none;
    }
    td.twocol-20
    {
        max-width:20em;
    }
    #FirstName
    {
        width: 18em;
    }
    #LastName
    {
        width: 18em;
    }
    #EmailTo
    {
        width: 30em;
    }
    #Subject
    {
        width: 30em;
    }
    #ReplyToAddress
    {
        width: 30em;
    }
    #EmailView
    {
        width: 30em;
    }
</style>
}

<h2>Email Campaign Add Email</h2>

@Html.ActionLink("Campaigns List", "EmailCampaigns")
@if (Model.MailModel != null)
{
    if ((Model.MailModel != null) && Model.MailModel.EmailCampaignId.HasValue)
    {
        <text> | </text>@Html.ActionLink("List Emails", "EmailCampaignEmailList", new { eventName = Model.EventShortName, id = Model.MailModel.EmailCampaignId.Value })
        <text> | </text>@Html.ActionLink("Edit Campaign", "EmailCampaignEdit", new { eventName = Model.EventShortName, id = Model.MailModel.EmailCampaignId.Value })
    }<br />
    
    <div style="min-height:200px;">
    @Html.Partial("BasicMailInputPartial", Model.MailModel)
    </div>
}

@section sidebar {
    @if (User.IsInRole(CCRoles.RoleNames.BigCheeze))
    {
    <div id="eventTagsContainer" class="widget rounded-10">
    <ul>
        <li>@Html.ActionLink("Back to Email Home", "Index")</li>
        <li><i>@Html.ActionLink("Campaigns", "EmailCampaigns")</i>
            <ul>
                <li>&nbsp;&nbsp;<i>Add Email</i>
            </ul>
        </li>
        <li>@Html.ActionLink("Recent Emails", "RecentEmails")
        </li>
        <li>
            Email Tests:
            <ul>
                <li>@Html.ActionLink("Basic Test", "TestBasicMail")</li>
            </ul>
        </li>
    </ul>
    </div>
    }
}
